package ru.autofan.domain;

import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;

@Entity
@Table(name = "abstract_foto")
@Inheritance(strategy = InheritanceType.JOINED)
public abstract class Foto implements Serializable {

	private static final long serialVersionUID = 1L;

	@Column(length = 100000)
	private byte[] data;
	
	@Basic
	@Enumerated(EnumType.STRING)
	private FotoType type;
	
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;
	
	@Basic
	private Long number;

	public byte[] getData() {
		return data;
	}

	public void setData(byte[] data) {
		this.data = data;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getNumber() {
		return number;
	}

	public void setNumber(Long number) {
		this.number = number;
	}

	public FotoType getType() {
		return type;
	}

	public void setType(FotoType type) {
		this.type = type;
	}
	
}
